fid = fopen('c:\manoj\geomag\wdc\hyb\HYB93A.wdc','rt');
fid1 = fopen('c:\manoj\temp\HYB1993D.WDC','wt');
element = 'D';
flag = 1;
nline = 1;
switch element,
    case 'D',
        dummy1 = 'D';
        dummy2 = '1';
    case 'H',
        dummy1 = 'H';
        dummy2 = '3';
    case 'Z',
        dummy1 = 'Z';
        dummy2 = '7';
end;


while flag == 1,
S = fgetl(fid);

if S == -1,
    flag = 0;
    break;
end;

if S(8) == dummy1 | S(8) == dummy2;
fprintf(fid1,'%s\n',S);
nline = nline +1;
clear S;
end;
end;
fclose all;
